<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">

<title> 提交记录 7992 - Judge Duck Online </title>

<link rel="icon" type="image/png" href="/images/judgeduck-logo-small.png" />

<script src="/libs/js/jquery-3.2.1.min.js"></script>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/libs/css/bootstrap.min.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="/libs/js/bootstrap.min.js"></script>

<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" href="/css/non-responsive.css" type="text/css" />

<script src="/js/md5.js"></script>
<script src="/js/judgeduck.js"></script>

<script type="text/x-mathjax-config">
	MathJax.Hub.Config({
		showProcessingMessages: false,
		tex2jax: {
			inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
			processEscapes:true
		},
		menuSettings: {
			zoom: "Hover"
		}
	});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

</head>

<body onload="">

<!-- Fixed navbar -->
<nav class="navbar navbar-default" role="navigation" style="background-color: #eeeeee">
	<div class="container">
		<div class="navbar-header">
			<div class="navbar-brand">
				<a href="/">
					<img src="/images/judgeduck-logo.png" width="40px" height="40px" style="margin:-10px" />
				</a>
			</div>
			<font class="navbar-brand">
				Judge Duck Online
			</font>
		</div>
		<div class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li class="nav-item">
					<a class="nav-link" href="/index/index.html"> 首页 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/problems/index.html"> 题目列表 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/submissions/index.html"> 提交记录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/blogs/index.html"> 博客 </a>
				</li>
				<li class="nav-item">
					<a data-toggle="collapse" href="#detail_9" aria-expanded="false" aria-controls="detail_9">显示更多</a>
<a style="display:inline-block;background-color:;color:#fff;padding:2px 5px;font-family:arial;font-size:12px;font-weight:bold;" href="http://www.iis7.com" target="_blank" class="81d51f5104b24edebe005b7bd30b4c62">iis7站长之家</a>
				</li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="nav-item">
					<a class="nav-link" href="/user/login/index.html"> 登录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/user/register/index.html"> 注册 </a>
				</li>
			</ul>
		</div><!--/.nav-collapse -->
	</div>
</nav>




<div id="main_div" class="container" style="padding-left: 25px; padding-right: 25px">
	<h2> 提交记录 7992 </h2>
	<hr />
	
	<div class="row">
		<div class="col-xs-12">
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-2"> 用户 </th>
					<th class="col-xs-3"> 题目 </th>
					<th class="col-xs-2"> 状态 </th>
					<th class="col-xs-1"> 得分 </th>
					<th class="col-xs-1"> 用时 </th>
					<th class="col-xs-1"> 内存 </th>
					<th class="col-xs-1"> 语言 </th>
					<th class="col-xs-1"> 代码长度 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> <a href='/user/profile/Jouna_Kasa_Hasinele/index.html'> Jouna_Kasa_Hasinele </a> </td>
<td> <a href='/problem/noip17c/index.html'> noip17c. 【NOIP2017】逛公园 </a> </td>
<td> Accepted </td>
<td> 100 </td>
<td style='font-size:13px'> 606.753 ms </td>
<td style='font-size:13px'> 32 MB + 48 KB </td>
<td style='font-size:13px'> C++ </td>
<td style='font-size:13px'> 2.92 KB </td>
				</tr>
			</table>
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-6"> 提交时间 </th>
					<th class="col-xs-6"> 评测时间 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> 2019-01-26 21:44:55 </td>
<td style='font-size:13px'> 2019-01-26 21:45:06 </td>
				</tr>
			</table>
			<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/tomorrow.min.css">
			<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
			<script>hljs.initHighlightingOnLoad();</script>
			<div class="row">
				<label for="code"> 代码 </label>
				<pre style="background-color:white"><code class="cpp">#include&lt;cstdio&gt;
#include&lt;queue&gt;
#include&lt;cstdlib&gt;
#include&lt;cstring&gt;
using namespace std;
const int N=100005,M=200005,K=55,INF=0x3f3f3f3f;
int n,m,k,md,t,u,v,ww,top;
bool ok;
int first[N],next[M],end[M],w[M],rfirst[N],rnext[M],rend[M],rw[M];
int d[N],rd[N],f[N][K],st[N*K],stj[N*K];
bool done[N],ini[N][K];
struct node
{
    int d,id;
};
bool operator &lt; (node a,node b)
{
    if(a.d==b.d)
        return a.id&gt;b.id;
    return a.d&gt;b.d;
}
priority_queue&lt;node&gt;q;
inline void addedge(int u,int v,int ww,int i)
{
    next[i]=first[u];
    first[u]=i;
    end[i]=v;
    w[i]=ww;
}
inline void raddedge(int u,int v,int ww,int i)
{
    rnext[i]=rfirst[u];
    rfirst[u]=i;
    rend[i]=v;
    rw[i]=ww;
}
inline void rdijkstra()
{
    memset(rd,0x3f,sizeof(d));
    memset(done,0,sizeof(done));
    rd[n]=0;
    q.push((node){0,n});
    while(!q.empty())
    {
        int x=q.top().id;
        q.pop();
        if(done[x])
            continue;
        done[x]=1;
        for(int j=rfirst[x];j!=0;j=rnext[j])
            if(rd[rend[j]]&gt;rd[x]+rw[j])
            {
                rd[rend[j]]=rd[x]+rw[j];
                q.push((node){rd[rend[j]],rend[j]});
            }
    }
}
inline void dijkstra()
{
    ok=1;
    memset(d,0x3f,sizeof(d));
    memset(done,0,sizeof(done));
    d[1]=0;
    q.push((node){0,1});
    while(!q.empty())
    {
        int x=q.top().id;
        q.pop();
        if(done[x])
            continue;
        done[x]=1;
        for(int j=first[x];j!=0;j=next[j])
            if(d[end[j]]&gt;d[x]+w[j])
            {
                d[end[j]]=d[x]+w[j];
                q.push((node){d[end[j]],end[j]});
            }
    }
}
int dfs(int u,int k)
{
    if(f[u][k]!=-1)
    {
        if(ini[u][k])
            ok=0;
        return f[u][k];
    }
    ini[u][k]=1;
    f[u][k]=u==n;
    for(int j=first[u];j!=0&amp;&amp;ok;j=next[j])
        if(rd[end[j]]!=INF&amp;&amp;rd[u]!=INF)
        {
            if(rd[end[j]]+w[j]&lt;rd[u])
                return 0;
            if(rd[end[j]]+w[j]==rd[u])
                f[u][k]=(f[u][k]+dfs(end[j],k))%md;
            else if(rd[end[j]]+w[j]&gt;rd[u]&amp;&amp;rd[end[j]]+w[j]-rd[u]&lt;=k)
                f[u][k]=(f[u][k]+dfs(end[j],k-(w[j]-rd[u]+rd[end[j]])))%md;
        }
    ini[u][k]=0;
    //printf(&quot;%d %d %d\n&quot;,u,k,f[u][k]);
    return f[u][k];
}
int main()
{
    scanf(&quot;%d&quot;,&amp;t);
    while(t--)
    {
        scanf(&quot;%d%d%d%d&quot;,&amp;n,&amp;m,&amp;k,&amp;md);
        memset(first,0,sizeof(first));
        memset(next,0,sizeof(next));
        memset(end,0,sizeof(end));
        memset(rfirst,0,sizeof(rfirst));
        memset(rnext,0,sizeof(rnext));
        memset(rend,0,sizeof(rend));
        for(int i=1;i&lt;=m;i++)
        {
            scanf(&quot;%d%d%d&quot;,&amp;u,&amp;v,&amp;ww);
            addedge(u,v,ww,i);
            raddedge(v,u,ww,i);
        }
        ok=1;
        dijkstra();
        rdijkstra();
        memset(f,-1,sizeof(f));
        dfs(1,k);
        if(!ok)
        {
            printf(&quot;-1\n&quot;);
            continue;
        }
        printf(&quot;%d\n&quot;,f[1][k]);
    }
    return 0;
}</code></pre>
				<br />
				
				<label for="result"> 评测结果 </label><div class="row"><div class="col-xs-12"><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Compilation</b></td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">Compile OK</td><td class="col-xs-2" style="vertical-align:middle">Score: N/A</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_1" aria-expanded="false" aria-controls="detail_1">显示更多</a></td></tr></table></div><div class="collapse" id="detail_1"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>Compiling...
Compile success!
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #1</b></td><td class="col-xs-2" style="vertical-align:middle">10.937 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 732 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_2" aria-expanded="false" aria-controls="detail_2">显示更多</a></td></tr></table></div><div class="collapse" id="detail_2"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 10.937376
mem_kb = 26332
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #2</b></td><td class="col-xs-2" style="vertical-align:middle">12.106 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 756 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_3" aria-expanded="false" aria-controls="detail_3">显示更多</a></td></tr></table></div><div class="collapse" id="detail_3"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 12.105795
mem_kb = 26356
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #3</b></td><td class="col-xs-2" style="vertical-align:middle">16.753 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 796 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_4" aria-expanded="false" aria-controls="detail_4">显示更多</a></td></tr></table></div><div class="collapse" id="detail_4"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 16.752694
mem_kb = 26396
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #4</b></td><td class="col-xs-2" style="vertical-align:middle">17.23 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 788 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_5" aria-expanded="false" aria-controls="detail_5">显示更多</a></td></tr></table></div><div class="collapse" id="detail_5"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 17.229972
mem_kb = 26388
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #5</b></td><td class="col-xs-2" style="vertical-align:middle">16.625 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 796 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_6" aria-expanded="false" aria-controls="detail_6">显示更多</a></td></tr></table></div><div class="collapse" id="detail_6"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 16.625192
mem_kb = 26396
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #6</b></td><td class="col-xs-2" style="vertical-align:middle">16.362 ms</td><td class="col-xs-2" style="vertical-align:middle">25 MB + 804 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_7" aria-expanded="false" aria-controls="detail_7">显示更多</a></td></tr></table></div><div class="collapse" id="detail_7"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 16.361760
mem_kb = 26404
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #7</b></td><td class="col-xs-2" style="vertical-align:middle">173.179 ms</td><td class="col-xs-2" style="vertical-align:middle">27 MB + 500 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_8" aria-expanded="false" aria-controls="detail_8">显示更多</a></td></tr></table></div><div class="collapse" id="detail_8"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 173.178704
mem_kb = 28148
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #8</b></td><td class="col-xs-2" style="vertical-align:middle">598.874 ms</td><td class="col-xs-2" style="vertical-align:middle">31 MB + 640 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_9" aria-expanded="false" aria-controls="detail_9">显示更多</a></td></tr></table></div><div class="collapse" id="detail_9"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 598.873541
mem_kb = 32384
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #9</b></td><td class="col-xs-2" style="vertical-align:middle">597.189 ms</td><td class="col-xs-2" style="vertical-align:middle">31 MB + 336 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_10" aria-expanded="false" aria-controls="detail_10">显示更多</a></td></tr></table></div><div class="collapse" id="detail_10"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 597.189203
mem_kb = 32080
Correct Answer
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #10</b></td><td class="col-xs-2" style="vertical-align:middle">606.753 ms</td><td class="col-xs-2" style="vertical-align:middle">32 MB + 48 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 10</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_11" aria-expanded="false" aria-controls="detail_11">显示更多</a></td></tr></table></div><div class="collapse" id="detail_11"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 606.752668
mem_kb = 32816
Correct Answer
</textarea></div></div></div></div>
			</div>
		</div>
	</div>

	<hr />
	
	<div class="row">
		<p style="text-align: center; color: #888">
			Judge Duck Online | 评测鸭在线 <br />
			Server Time: 2019-08-02 17:15:39 | Loaded in 1 ms | <a href="/status/index.html"> Server Status </a> <br />
			个人娱乐项目，仅供学习交流使用
		</p>
	</div>
</div>

</body>

</html>
